//
//  CommentTableViewCell.m
//  觅影
//
//  Created by lanou on 16/4/8.
//  Copyright © 2016年  陶虹. All rights reserved.
//

#import "CommentTableViewCell.h"

@interface CommentTableViewCell ()

@property (weak, nonatomic) IBOutlet UIImageView *picImageView;

@property (weak, nonatomic) IBOutlet UILabel *nameLabel;

@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;

@end

@implementation CommentTableViewCell


-(void)setModel:(CommentModel *)model
{
    _model = model;
    [self.picImageView sd_setImageWithURL:[NSURL URLWithString:model.header]];
    self.nameLabel.text = model.username;
    self.timeLabel.text = model.date;
    self.contentLabel.text = model.content;

}

+ (CGFloat)cellForHeight:(CommentModel *)model
{
    CGRect bounds = [model.content boundingRectWithSize:CGSizeMake(KWIDTH - 50, 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:13] forKey:NSFontAttributeName] context:nil];
    return bounds.size.height + 75;
}



@end
